package mhys.Dao;

import mhys.Entity.Score;

public class ScoreDao extends BaseDao{
    //添加成绩
    public int addScore(Score score){
        String sql = "INSERT INTO score values(?,?,?,?)";
        return insertUpdateDelete(sql, score.getS_id(),score.getObject(),score.getScore(),score.getPoint());
    }
    //修改成绩
    public int updateScore(Score score){
        String sql = "UPDATE score SET object = ?,score = ?,point = ? WHERE s_id = ?";
        return insertUpdateDelete(sql,score.getObject(),score.getScore(),score.getPoint(),score.getS_id());
    }

    public static void main(String[] args) {
        ScoreDao scoreDao = new ScoreDao();
        Score score = new Score(1,"java",90.0,10.0);
        scoreDao.addScore(score);
    }
}
